$(function () {
    function copy(control,value) {
        $(control).zclip({
            path: "/static/swf/ZeroClipboard.swf",
            copy: function(){
                return $(value).val();
            },
            beforeCopy:function(){/* 按住鼠标时的操作 */
                $(value).css("color","orange");
            },
            afterCopy:function(){/* 复制成功后的操作 */
                var $copysuc = $("<div class='copy-tips'><div class='copy-tips-wrap'>☺ 复制成功</div></div>");
                $("body").find(".copy-tips").remove().end().append($copysuc);
                $(".copy-tips").fadeOut(3000);
            }
        });
    }
    copy("#controlCopyURL", "#copyURL");
    copy("#controlCopyHTML", "#copyHTML");
    copy("#controlCopyMarkdown", "#copyMarkdown");
})
